package iterator;

/**
 * @Author: Doream
 * @Date: 2022/1/30 12:40
 */
public class Client {
    public static void main(String[] args) {
        StudentAggregateImpl studentAggregate = new StudentAggregateImpl();
        studentAggregate.addStudet(new Student("张三",1));
        studentAggregate.addStudet(new Student("李四",2));
        studentAggregate.addStudet(new Student("王五",3));
        StudentIterator studentIterator = studentAggregate.getStudentIterator();
        while (studentIterator.hasNext()){
            System.out.println(studentIterator.next());
        }
    }
}
